home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / ib.792 < prev    next >
Text File  |  1992-02-06  |  4KB  |  86 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f3\fmodern Ohlfs;\f2\fmodern Courier;\f1\fswiss Helvetica;}
  2. \paperw13880
  3. \paperh10800
  4. \margl120
  5. \margr120
  6. {\colortbl\red0\green0\blue0;}
  7. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ul0\fs28\fc0 InterfaceBuilder subprojects bug workaround
  8. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600 \
  9. \
  10.  
  11. \fc0 Q: How can I use a class from a subproject in another project?\
  12. \
  13. A: You can drag any .h file from a subproject into the classes suitcase of another project's nib.  From there you can instantiate, and make connections freely.\
  14. \
  15. Q: How can I make connections between objects in my subproject and those in the main project?\
  16. \
  17. A: You can't.  You need to make the association in your code.  The object that is the nib file's owner should take care of communicating with any other objects (including the owners of other nib files).\
  18. \
  19. See NeXTanswer appkit.699 for more information regarding objects communicating between nib files.\
  20. \
  21. Q:  When I modify the definition of a class that is located in a subproject, how do I get InterfaceBuilder to recognize the new outlets or actions?  Parse just gives me an error: "Cannot find class definition."\
  22. \
  23. A:  This is a limitation of InterfaceBuilder in its current incarnation.  Once a class definition (or .h file) has been dropped into the classes suitcase from the Workspace Manager, InterfaceBuilder does not have any idea where the files for that class are located.  Therefore, you cannot parse classes from a subproject.  You must simply drag the .h file onto the class suitcase again.  InterfaceBuilder will then display an alert panel indicating that there are different outlets or actions for that class.  Choose "Replace" and the class will change to reflect the changes made to the .h file.\
  24. \
  25. Q: The debugger can't find the source files to my subproject classes.  Help!\
  26. \
  27. A: You must notify 
  28. \b gdb
  29. \b0  where the subproject files are located.  You can accomplish this with the 
  30. \b directory
  31. \b0  or 
  32. \b idirectory
  33. \b0  commands in 
  34. \b gdb
  35. \b0 :\
  36. \
  37.  
  38. \f3\fs22     (gdb) dir <
  39. \f2\i\fs24 pathname
  40. \f3\i0\fs22 >\
  41.     \
  42.  
  43. \f0\fs28 If you don't want to have to type this every time you invoke 
  44. \b gdb
  45. \b0 , place this command in your 
  46. \b .gdbinit
  47. \b0  file. See the 
  48. \b gdb
  49. \b0  man page for more information.\
  50. \
  51. Q: Is there an easy way to include subproject class definitions in the main project of my application?\
  52. \
  53. A: Yes, there is.  When you compile the subproject 
  54. \b foo.subproj
  55. \b0 ,
  56. \b  
  57. \b0 a .h file for the entire subproject will be created in the main project's directory.  You can import this .h file.  The name of the .h file, in the case of our example, will be 
  58. \b foo.h
  59. \b0 .  This file imports all of the class definitions contained in the subproject 
  60. \b foo.subproj
  61. \b0 . This may be overkill, especially if you have many classes in your subproject that are not interdependent.  If so, you can also include them individually by using the following import command:\
  62. \
  63.  
  64. \f3\fs22     #import "foo.subproj/FooBar.h\
  65.  
  66. \f0\fs28 \
  67. Q: When I try to 
  68. \b make 
  69. \b0 an application containing a subproject, I get the following error:\
  70. \
  71.  
  72. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f3\fs22\fc0     (cd foo.subproj; make ofiles "NAME=foo" "_CFLAGS= -O -g -Wall"  "OFILE_DIR = obj" "LIBS=")\
  73.     mkdirs obj\
  74.     ld -r -o ../obj/foo.o\
  75.     ld: no object files specified\
  76.  
  77. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\fs28\fc0 \
  78. A: This is an InterfaceBuilder bug that you'll encounter if your subproject contains no class definition files.   Consider whether you really need a subproject in this case.  The workaround is to create a dummy class and add its .h and .m files to your subproject.  \
  79. \
  80. QA792\
  81. \
  82. Not valid for 1.0    (subprojects were added for 2.0)\
  83. Valid for 2.0\
  84. \
  85.  
  86.